package command;

/**
 * 客户端
 */
public class Client {
	public static void main(String[] args) {
		// 创建电灯
		LightReceiver lightReceiver = new LightReceiver();
		// 创建电灯相关的开关命令
		LightOnCommand lightOnCommand = new LightOnCommand(lightReceiver);
		LightOffCommand lightOffCommand = new LightOffCommand(lightReceiver);
		// 创建一个遥控器
		RemoteController remoteController = new RemoteController();
		remoteController.setCommand(0, lightOnCommand, lightOffCommand);
		System.out.println("点击遥控器开按钮");
		remoteController.onButtonClicked(0);
		System.out.println("点击遥控器关按钮");
		remoteController.offButtonClicked(0);
		System.out.println("点击遥控器撤销按钮");
		remoteController.undoButtonClicked(0);
	}
}
